import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'; // 引入路由配置
import ElementPlus from 'element-plus';


//import './assets/styles/index.scss' // global css

import 'element-plus/dist/index.css';
import  downFile  from './utils/request.js'


// 分页组件
import Pagination from '@/components/Pagination'

// svg图标
import './assets/iconfont/iconfont.js' //iconfont
//import 'virtual:svg-icons-register'
import SvgIcon from './components/SvgIcon/index.vue'
import elementIcons from './components/SvgIcon/svgicon.js'


import {  parseTime, resetForm, addDateRange, handleTree, selectDictLabel, download } from '@/utils/ruoyi'
import { getDicts } from './api/system/dict/data.js'
import { getConfigKey } from './api/config/config'

// 注册指令
import plugins from './plugins' // plugin


// 字典标签组件
import DictTag from './components/DictTag/index.vue'

const app = createApp(App);
app.config.globalProperties.getConfigKey = getConfigKey
app.config.globalProperties.download = download
app.config.globalProperties.downFile = downFile
app.config.globalProperties.parseTime = parseTime
app.config.globalProperties.resetForm = resetForm
app.config.globalProperties.handleTree = handleTree
app.config.globalProperties.addDateRange = addDateRange
app.config.globalProperties.selectDictLabel = selectDictLabel
app.config.globalProperties.getDicts = getDicts


// 全局组件挂载
app.component('DictTag', DictTag)
app.component('Pagination', Pagination)
app.component('svg-icon', SvgIcon)


app.use(ElementPlus);
app.use(router);
app.use(plugins);
app.use(elementIcons)
app.mount('#app');